home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0182_Get the Video Page.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  1KB  |  27 lines

  1. {
  2. From: josephw@ramp.com (Joe Wilcox)
  3. >> Are there any Pascal function/procedures that will return to me the DOS
  4. >> segment of the current video page? If not, is there an easy way
  5. >> to do this? Thanks!
  6. >Not built-in Pascal, as far as I know (perhaps in graphics mode, using the
  7. >Graph unit, but I don't use it).  In text mode, each screen takes 2*80*25 =
  8. >4000 bytes, so I think you simply add a 4K (that is, 4096) offset for each
  9. >logical page.  Screen mode 3, co80, mem. starts at phys. address B8000h.
  10.  
  11. Ok, if you are trying to find the segment in text mode, it's real easy..
  12. here is a function...
  13. }
  14.  
  15. function GetVPage : word;
  16. asm
  17.   mov BX,$B000;  { Default is monochrome segment      }
  18.   mov AH,$0F;    { Bios function 0Fh : Get Video Mode }
  19.   int $10;       { Do a Bios video interrupt          }
  20.   cmp AL,$07;    { Are we in monochrome?              }
  21.   je @@Done;     { Yes, then jump                     }
  22.   mov BX,$B800;  { Set it to the color segment        }
  23.  @@Done:
  24.   mov AX,BX;     { Return the value in AX             }
  25. end;
  26.  
  27.